package com.rcloud.server.whiteboard.util;import org.apache.commons.codec.binary.Hex;import java.nio.charset.StandardCharsets;import java.security.MessageDigest;public class SignUtil {    public static String sign(String secret,String nonce, String timestamp ){        StringBuilder toSign = new StringBuilder(secret).append(nonce).append(                timestamp);        String sign = hexSHA1(toSign.toString());        return sign;    }    public static String hexSHA1(String value) {        try {            MessageDigest md = MessageDigest.getInstance("SHA-1");            md.update(value.getBytes(StandardCharsets.UTF_8));            byte[] digest = md.digest();            return Hex.encodeHexString(digest);        } catch (Exception ex) {            throw new RuntimeException(ex);        }    }}